package edu.hgnc.selfEditor2;

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.factory.config.CustomEditorConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource(value = "classpath:cfg.properties",encoding = "UTF-8")
public class AddressPropertyConfiguration {
	@Bean
	public Customer getCustomer(){
		return new Customer();
	}
	@Bean
	public CustomEditorConfigurer customEditorConfigurer(){
		CustomEditorConfigurer configurer = new CustomEditorConfigurer();
		PropertyEditorRegistrar[] pers = new PropertyEditorRegistrar[]{new AddressPropertyEditorRegister()};
		configurer.setPropertyEditorRegistrars(pers);
		return configurer;
	}
}
